From 25785f1eec8db3ef580596682c0ad1f84c746c03 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 2 Jun 2025 16:34:16 -0400 Subject: [PATCH] ci: use srcdir != builddir by default, builddir under target/ This blends better with docker builds where we have a blanket ignore of `target` in .dockerignore. Right now we use git.mk to generate .gitignore and autotools drop stuff all over the place. Signed-off-by: Colin Walters --- .cci.jenkinsfile | 8 +++++--- .github/workflows/rust.yml | 2 +- ci/libbuild.sh | 9 +++++++-- ci/prow/Dockerfile | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.cci.jenkinsfile b/.cci.jenkinsfile index eb891ab4..bed0aa79 100644 --- a/.cci.jenkinsfile +++ b/.cci.jenkinsfile @@ -24,7 +24,7 @@ stage("Build") { stage("Unit tests") { try { shwrap(""" - make check + make -C target/c check """) } finally { shwrap("cat test-suite.log || true") @@ -32,11 +32,13 @@ stage("Build") { } } stage("Build installed tests") { - shwrap("make -C tests/kolainst") + shwrap(""" + make -C tests/kolainst + """) } stage("Generate artifacts") { shwrap(""" - make install DESTDIR=\$(pwd)/installed/rootfs + make -C target/c install DESTDIR=\$(pwd)/installed/rootfs make -C tests/kolainst install DESTDIR=\$(pwd)/installed/tests bash -c '. /usr/lib/os-release && echo \$VERSION_ID' >\$(pwd)/installed/buildroot-id """) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 21ce65e1..0e62cd5b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -55,7 +55,7 @@ jobs: - name: Build libostree run: ./ci/build.sh - name: Install libostree - run: make install + run: make -C target/c install - name: Rust build run: cargo test --no-run --verbose --features=${{ env['LATEST_LIBOSTREE'] }} - name: Run tests diff --git a/ci/libbuild.sh b/ci/libbuild.sh index def327af..d5636805 100644 --- a/ci/libbuild.sh +++ b/ci/libbuild.sh @@ -6,6 +6,10 @@ OS_ID=$(. /etc/os-release; echo $ID) OS_ID_LIKE=$(. /etc/os-release; echo $ID ${ID_LIKE:-}) OS_VERSION_ID=$(. /etc/os-release; echo $VERSION_ID) +# Drop our content underneath target/ by default as it's already +# ignored by rust +BUILDDIR=target/c + pkg_upgrade() { dnf -y distro-sync } @@ -16,8 +20,9 @@ make() { build() { env NOCONFIGURE=1 ./autogen.sh - ./configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@" - make V=1 + mkdir -p target/c + (cd target/c && ../../configure --sysconfdir=/etc --prefix=/usr --libdir=/usr/lib64 "$@") + make -C target/c V=1 } pkg_install() { diff --git a/ci/prow/Dockerfile b/ci/prow/Dockerfile index 8fee585a..40494256 100644 --- a/ci/prow/Dockerfile +++ b/ci/prow/Dockerfile @@ -1,7 +1,8 @@ FROM quay.io/coreos-assembler/fcos-buildroot:testing-devel as builder WORKDIR /src COPY . . -RUN env ./ci/build.sh && make install DESTDIR=/cosa/component-install +RUN ./ci/build.sh +RUN make -C target/c install DESTDIR=/cosa/component-install RUN make -C tests/kolainst RUN make -C tests/kolainst install DESTDIR=/cosa/component-tests # Uncomment this to fake a build to test the code below -- 2.30.2